from base.base import Base
from selenium.webdriver.common.by import By
class SettlePage(Base):
    # 结算管理
    collapsable_loc=(By.XPATH,'/html/body/div[1]/div[2]/div[2]/div[2]/div[11]/h2')
    def collapsable(self):
        self.click(self.collapsable_loc)

    # 结算记录管理
    settle_manage_loc=(By.XPATH,'//a[@href="sett/list"]')
    def settle_manage(self):
        self.times(3)
        self.click(self.settle_manage_loc)

    # 发起结算
    add_settle_loc=(By.XPATH,'/html/body/div[1]/div[3]/div/div[2]/div[2]/div[2]/div[1]/ul/li[1]/a/span')
    def add_settle(self):
        self.click(self.add_settle_loc)

    # 用户编号
    userNo_loc=(By.ID,'userNo')
    def userNo(self):
        self.send_keys(self.userNo_loc,'81979153012336332802')

    # 用户姓名
    user_userName_loc=(By.NAME,'user.userName')
    def user_userName(self):
        self.send_keys(self.user_userName_loc,'庞明慧')

    # 可结算金额
    settAmount_loc = (By.ID, 'settAmount')
    def settAmount(self):
        self.send_keys(self.settAmount_loc, '0')

    # 结算金额
    settle_amount_loc = (By.CLASS_NAME, 'required.digits.textInput')
    def settle_amount(self):
        self.send_keys(self.user_userName_loc, '0')

    # 提交
    submit_loc=(By.XPATH,'/html/body/div[1]/div[3]/div/div[2]/div[3]/div/form/div[2]/ul/li[1]/div/div/button')
    def submit(self):
        self.click(self.submit_loc)

    # 搜索框
    userName_loc=(By.XPATH,'/html/body/div[1]/div[3]/div/div[2]/div[2]/div[1]/form/div/table/tbody/tr/td[1]/input')
    def userName(self):
        self.send_keys(self.userName_loc,'庞明慧')

    # 搜索按钮
    search_loc=(By.XPATH,'/html/body/div[1]/div[3]/div/div[2]/div[2]/div[1]/form/div/table/tbody/tr/td[2]/div/div/button')
    def search(self):
        self.click(self.search_loc)

    # 查看
    find_loc=(By.XPATH,'/html/body/div[1]/div[3]/div/div[2]/div[2]/div[2]/div[2]/div[2]/div/table/tbody/tr[1]/td[10]/div/a[1]')
    def find(self):
        self.click(self.find_loc)

    # 关闭
    close_loc=(By.CLASS_NAME,'close')
    def close(self):
        self.click(self.close_loc)

    # 审核
    audit_loc=(By.XPATH,'/html/body/div[1]/div[3]/div/div[2]/div[2]/div[2]/div[2]/div[2]/div/table/tbody/tr[1]/td[10]/div/a[2]')
    def audit(self):
        self.click(self.audit_loc)

    # 是否通过，是
    settStatus_loc=(By.NAME,'settStatus')
    def settStatus(self):
        self.click(self.settStatus_loc)

    # 审核备注
    remark_loc=(By.NAME,'remark')
    def remark(self):
        self.send_keys(self.remark_loc,'UI自动化操作填审核备注')

    # 提交审核
    remark_submit_loc=(By.XPATH,'/html/body/div[1]/div[3]/div/div[2]/div[3]/div/form/div[2]/ul/li[1]/div/div/button')
    def remark_submit(self):
        self.click(self.remark_submit_loc)
